#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<set>
using namespace std;
int main()
{
	set<int> st = { 1,2,3,5,4,5,6,76 };
	auto it = st.lower_bound(2);
	auto it1 = st.upper_bound(5);
	for (auto e : st)
	{
		cout << e << " ";
	}
	st.erase(it, it1);
	for (auto e : st)
	{
		cout << e << " ";
	}
	return 0;
}